home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AppleShare API / ServerControl / ServerControlIntf.a next >
Encoding:
Text File  |  1992-05-19  |  13.3 KB  |  319 lines  |  [TEXT/MPS ]

  1.  
  2. ; Created: Friday, May 8, 1992 6:25 PM
  3. ;
  4. ; File: ServerControlIntf.a
  5. ;
  6. ; Assembler Interface to the Macintosh Libraries
  7. ; Copyright Apple Computer, Inc. 1990
  8. ; All Rights Reserved
  9. ;
  10. ;___________________________________________________________________________
  11.  
  12.  IF (&TYPE('__ServerControlIntf__') = 'UNDEFINED') THEN
  13. __ServerControlIntf__   SET 1
  14.  
  15.  IF &TYPE('__Types__') = 'UNDEFINED' THEN
  16.  INCLUDE 'Types.a'
  17.  ENDIF
  18.  
  19.  IF &TYPE('__AppleTalk__') = 'UNDEFINED' THEN
  20.  INCLUDE 'AppleTalk.a'
  21.  ENDIF
  22.  
  23.  
  24. ; ServerDispatch can be called synchronously only. 
  25. ; Asynchronous server control calls are not supported. 
  26. ; Inputs:    A0 points to the SCParamBlockRec. 
  27. ;                D0 must be zero. 
  28. ;               SCParamBlockRec.scCode indicates the server control call. 
  29. ; Outputs:    D0.w and SCParamBlockRec.ioResult contain the result code. 
  30. ; Note:        Macintosh File Sharing does not return the result in D0.w 
  31. ;                so you'll need to add "MOVE.W    ioResult(A0),D0" after ServerDispatch. 
  32.  
  33. _ServerDispatch            OPWORD        $A094 ; The server control dispatch trap.
  34.  
  35.                                 Macro
  36.                                 _SyncServerDispatch
  37.                                 MOVEQ       #$00,D0
  38.                                 _ServerDispatch
  39.                                 MOVE.W    $10(A0),D0    ;put result in D0 for Macintosh File Sharing
  40.                                 Endm
  41.  
  42.  
  43. ; scCode values 
  44. SCStartServer            EQU     0
  45. SCShutDown               EQU     2
  46. SCCancelShutDown         EQU     3
  47. SCDisconnect             EQU     4
  48. SCPollServer             EQU     5
  49. SCGetExpFldr             EQU     6
  50. SCGetSetupInfo           EQU     7
  51. SCSetSetupInfo           EQU     8
  52. SCSendMessage            EQU     9
  53. SCGetServerStatus        EQU     10
  54. SCInstallServerEventProc EQU     11
  55. SCRemoveServerEventProc  EQU     12
  56. SCGetServerEventProc     EQU     13
  57. SCServerVersion          EQU     14
  58. SCSetCopyProtect         EQU     16
  59. SCClrCopyProtect         EQU     17
  60. SCDisconnectVolUsers     EQU     18
  61. SCGetUserNameRec         EQU     19
  62. SCGetUserMountInfo       EQU     20
  63. SCWakeServer             EQU     21
  64. SCSleepServer            EQU     22
  65.  
  66.  
  67. ;scFlags bits and masks for disconnectPB 
  68. bUNRFSendMsg             EQU     13    ; send a message 
  69. UNRFSendMsgMask          EQU     $2000 ; send a message 
  70.  
  71.  
  72. ;These are error codes that are returned from an SCDisconnect trap 
  73. AlreadyShuttingDown      EQU     -1    ; the server is already shutting down 
  74. AlreadyDisconnecting     EQU     -2    ; the server is already disconnecting 
  75.  
  76.  
  77. ; scServerType contains the server type, which is interpreted as follows: 
  78. MFSType                  EQU     $0000 ; Macintosh File Sharing 
  79. AFSType                  EQU     $0001 ; AppleShare File Server 
  80.  
  81.  
  82. ; scServerVersion is the server version, which is currently interpreted as follows: 
  83. ; $0030 : File Sharing Extension, versions 7.0 and 7.0.1 
  84. ; $0031 : File Server Extension, version 3.0 
  85. ; $0032 : File Sharing Extension, version 7.0.2 
  86.  
  87. ; These are some random constants for SCStartServer 
  88. kCurInstalled            EQU     0     ; the currently installed server 
  89. kFinderExtn              EQU     0     ; send high level events to the finder extension 
  90.  
  91.  
  92. ;scServerFlags bits returned by SCGetServerStatus 
  93. bJBSEnabled              EQU     12    ; Set if Apple II boot service is enabled 
  94.  
  95.  
  96. ; These "SCPS" integers are passed back from a SCPollServer call in scServerState: 
  97. ; 0 means: 0 <= seconds left < 30 and Network Setup says : "Less than a minute" 
  98. ; 1 means: 30 <= seconds left < 90 and Network Setup says : "About a minute" 
  99. ; 2 thru 4094: x*60-30 <= seconds left < x*60+30 and NS says: "About X minutes" 
  100. SCPSRunning              EQU     -1    ; Server running normally 
  101. SCPSStartingUp           EQU     -2    ; Server is in the process of starting up 
  102. SCPSJustDisabled         EQU     -3    ; Server is just disabled and there was no startup error 
  103. SCPSDisabledwErr         EQU     -4    ; Server is disabled and there is an "SE" error in scServerError 
  104. SCPSSleeping             EQU     -5    ; Server is temporarily disabled 
  105.  
  106.  
  107. ; These "SCPD" integers are passed back from a SCPollServer call in scDisconnectState: 
  108. ; 0 means: 0 <= seconds left < 30 and FileShare Monitor says : "Less than a minute" 
  109. ; 1 means: 30 <= seconds left < 90 and FileShare Monitor says : "About a minute" 
  110. ; 2 thru 4094: x*60-30 <= seconds left < x*60+30 and FM says: "About X minutes" 
  111. SCPDNotDisconnecting     EQU     -1    ; Server not disconnecting some one or some group of users 
  112.  
  113.  
  114. ; These are Server Errors ("SE") error codes returned in scServerError by a SCPollServer call 
  115. SENoUGFileOpenErr        EQU     1     ; "The Users & Groups file could not be opened." 
  116. SENoRealVolsErr          EQU     2     ; "There are no volumes for AppleShare to use." 
  117. SEInsuffMFMemErr         EQU     4     ; "There was not enough memory available to start AppleShare File Service." 
  118. SECantRegNameErr         EQU     5     ; "The File Server's name could not be registered on the AppleTalk Network." 
  119. SECantFindExtnFolder     EQU     6     ; "The File Server could not be started because the Extensions folder could not be found" 
  120. SEUnExATalkErr           EQU     7     ; "An unexpected AppleTalk error occurred." 
  121. SENoMachineName          EQU     8     ; "You must have a machine name." 
  122. SECantFindFSExtn         EQU     9     ; "The File Server could not be started because the File Sharing Extension could not be found" 
  123. SEATalkOffErr            EQU     10    ; "Appletalk is turned off." 
  124. SEAppleTalkErr           EQU     11    ; "AppleTalk could not be activated." 
  125. SENoInitRunErr           EQU     12    ; "AppleShare Setup file is not installed in the Server Folder." 
  126. SESysTooOldErr           EQU     13    ; "The System File is too old for AppleShare (v3.0)." 
  127. SEInsuffAppMemErr        EQU     14    ; "There was not enough memory for FileShare to startup." 
  128. SEBadConfigErr           EQU     15    ; "AppleShare encountered a problem with the current configuration." 
  129. SENoDTOnStartupErr       EQU     16    ; "The Desktop database on volume the startup volume could not be opened." 
  130. SEDupNameErr             EQU     17    ; "Duplicate name error when registering.  Please choose another name." 
  131.  
  132. SetupInfoRec             RECORD  0
  133. SIVersion                DS.W    1     ; short:  SetupInfoRec version: 1 for File Sharing and AppleShare 3.0 
  134. SIFlags                  DS.W    1     ; short:  0 for File Sharing and AppleShare 3.0 
  135. SIMaxLogins              DS.W    1     ; short:  1..11 for File Sharing; 1..121 for AppleShare 3.0 
  136. SISrvrUsageLimit         DS.W    1     ; short:  10 to 100 (percent) 
  137. ; All remaining fields in record are only used by the AppleShare file server
  138. SIVolInfoLocation        DS         Point ; location of Volume Info window (default is -1,-1)
  139. SIVolInfoVisible         DS.W    1     ; Boolean: is volume Info windowvisible (default is TRUE)
  140. SIUserInfoLocation       DS         Point ; location of connected users window (default is -1,-1)
  141. SIUserInfoVisible        DS.W    1     ; Boolean: is connectd users window visible (default is true)
  142. SIShutDownMins           DS.W    1     ; short: default minutes until shutdown
  143. SISpare                  DS.W    17    ; Array of short : reserved
  144. SILoginMag               DS.B    200   ; tLoginMag (STRING[199]): the current login message
  145. size                     EQU     *
  146.                          ENDR
  147.  
  148.  
  149.  
  150. SCParamBlockHeader       RECORD  0
  151. qLink                    DS.L    1     ; QElemPtr
  152. qType                    DS.W    1     ; short
  153. ioTrap                   DS.W    1     ; short
  154. ioCmdAddr                DS.L    1     ; Ptr
  155. ioCompletion             DS.L    1     ; ProcPtr
  156. ioResult                 DS.W    1     ; OSErr
  157. size                     EQU     *
  158.                          ENDR
  159.  
  160.  
  161.  
  162. StartParam               RECORD  0
  163.                          DS         SCParamBlockHeader
  164. reserved                 DS.L    1     ; long
  165. reserved2                DS.W    1     ; short
  166. reserved3                DS.W    1     ; short
  167. scCode                   DS.W    1     ; short
  168. scStartSelect            DS.W    1     ; short
  169. scEventSelect            DS.W    1     ; short
  170. reserved4                DS.L    4     ; Array of long
  171. size                     EQU     *
  172.                          ENDR
  173.  
  174.  
  175. DisconnectParam          RECORD  0
  176.                          DS         SCParamBlockHeader
  177. scDiscArrayPtr           DS.L    1     ; LongIntPtr
  178. scArrayCount             DS.W    1     ; short
  179. reserved                 DS.W    1     ; short
  180. scCode                   DS.W    1     ; short
  181. scNumMinutes             DS.W    1     ; short
  182. scFlags                  DS.W    1     ; short
  183. scMessagePtr             DS.L    1     ; StringPtr
  184. size                     EQU     *
  185.                          ENDR
  186.  
  187.  
  188. PollServerParam          RECORD  0
  189.                          DS         SCParamBlockHeader
  190. reserved                 DS.L    1     ; long
  191. reserved2                DS.W    1     ; short
  192. reserved3                DS.W    1     ; short
  193. scCode                   DS.W    1     ; short
  194. scServerState            DS.W    1     ; short
  195. scDisconnectState        DS.W    1     ; short
  196. scServerError            DS.W    1     ; short
  197. scSecondsLeft            DS.L    1     ; long
  198. size                     EQU     *
  199.                          ENDR
  200.  
  201.  
  202. StandardParam            RECORD  0
  203.                          DS         SCParamBlockHeader
  204. scNamePtr                DS.L    1     ; StringPtr
  205. scVRefNum                DS.W    1     ; short
  206. scLogins                 DS.W    1     ; short
  207. scCode                   DS.W    1     ; short
  208. scIndex                  DS.W    1     ; short
  209. scDirID                  DS.L    1     ; long
  210. size                     EQU     *
  211.                          ENDR
  212.  
  213.  
  214. SetupParam               RECORD  0
  215.                          DS         SCParamBlockHeader
  216. scSetupPtr               DS.L    1     ; SetupInfoRecPtr
  217. scMaxVolumes             DS.W    1     ; short
  218. scMaxExpFolders          DS.W    1     ; short
  219. scCode                   DS.W    1     ; short
  220. scCurMaxSessions         DS.W    1     ; short
  221. size                     EQU     *
  222.                          ENDR
  223.  
  224.  
  225. StatusParam              RECORD  0
  226.                          DS         SCParamBlockHeader
  227. scNamePtr                DS.L    1     ; StringPtr
  228. reserved2                DS.W    1     ; short
  229. reserved3                DS.W    1     ; short
  230. scCode                   DS.W    1     ; short
  231. scServerFlags            DS.W    1     ; short
  232. scNumSessions            DS.W    1     ; short
  233. scUserListModDate        DS.L    1     ; long
  234. scActivity               DS.W    1     ; short
  235. scVolListModDate         DS.L    1     ; long
  236. size                     EQU     *
  237.                          ENDR
  238.  
  239.  
  240. ServerEventParam         RECORD  0
  241.                          DS         SCParamBlockHeader
  242. scSEQEntryPtr            DS.L    1     ; Ptr
  243. reserved2                DS.W    1     ; short
  244. reserved3                DS.W    1     ; short
  245. scCode                   DS.W    1     ; short
  246. size                     EQU     *
  247.                          ENDR
  248.  
  249.  
  250. VersionParam             RECORD  0
  251.                          DS         SCParamBlockHeader
  252. scExtNamePtr             DS.L    1     ; StringPtr
  253. reserved2                DS.W    1     ; short
  254. reserved3                DS.W    1     ; short
  255. scCode                   DS.W    1     ; short
  256. scServerType             DS.W    1     ; short
  257. scServerVersion          DS.W    1     ; short
  258. size                     EQU     *
  259.                          ENDR
  260.  
  261.  
  262. UserInfoParam            RECORD  0
  263.                          DS         SCParamBlockHeader
  264. scNamePtr                DS.L    1     ; StringPtr
  265. reserved2                DS.W    1     ; short
  266. reserved3                DS.W    1     ; short
  267. scCode                   DS.W    1     ; short
  268. scPosition               DS.L    1     ; long
  269. scUNRecID                DS.L    1     ; long
  270. scUserID                 DS.L    1     ; long
  271. scLoginTime              DS.L    1     ; long
  272. scLastUseTime            DS.L    1     ; long
  273. scSocketNum              DS         AddrBlockRec
  274. size                     EQU     *
  275.                          ENDR
  276.  
  277.  
  278. VolMountedParam          RECORD  0
  279.                          DS         SCParamBlockHeader
  280. reserved                 DS.L    1     ; Ptr
  281. scVRefNum                DS.W    1     ; short
  282. reserved3                DS.W    1     ; short
  283. scCode                   DS.W    1     ; short
  284. scFilesOpen              DS.W    1     ; short
  285. scWriteableFiles         DS.W    1     ; short
  286. scUNRecID                DS.L    1     ; long
  287. scMounted                DS.B    1     ; Boolean
  288. scMountedAsOwner         DS.B    1     ; Boolean
  289. size                     EQU     *
  290.                          ENDR
  291.  
  292.  
  293. SCParamBlockRec          RECORD  0
  294.                          ORG      SCParamBlockRec
  295. startPB                  DS      StartParam
  296.                          ORG      SCParamBlockRec
  297. disconnectPB             DS      DisconnectParam
  298.                          ORG      SCParamBlockRec
  299. pollServerPB             DS      PollServerParam
  300.                          ORG      SCParamBlockRec
  301. standardPB               DS      StandardParam
  302.                          ORG      SCParamBlockRec
  303. setupPB                  DS      SetupParam
  304.                          ORG      SCParamBlockRec
  305. statusPB                 DS      StatusParam
  306.                          ORG      SCParamBlockRec
  307. serverEventPB            DS      ServerEventParam
  308.                          ORG      SCParamBlockRec
  309. versionPB                DS      VersionParam
  310.                          ORG      SCParamBlockRec
  311. userInfoPB               DS      UserInfoParam
  312.                          ORG      SCParamBlockRec
  313. volMountedPB             DS      VolMountedParam
  314.                          ORG
  315. size                     EQU     *
  316.                          ENDR
  317.  
  318.  
  319.                          ENDIF    ;  ...already included